#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Last modified: 

"""docstring
"""

__revision__ = '0.1'

import urllib2
from BeautifulSoup import BeautifulSoup
outfile = open('/home/linuxfish/qiushi.txt','w')

data = urllib2.urlopen('http://www.qiushibaike.com').read()
soup = BeautifulSoup(data)
contents = soup.findAll('div','qiushi_body article ')
for num in range(len(contents)):
    para=contents[num].p
    title = 'Article %d\n' %(num+1)    #帖子计数

    print >> outfile,title+str(para).replace('<br />','\n').replace('<p>','').replace('</p>',''),
outfile.close()
